﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>TreeSelectColumn</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" /><link href="../demo.css" rel="stylesheet" type="text/css" />

    
    <script src="../../scripts/boot.js" type="text/javascript"></script> 
    
    
</head>
<body>
    <h1>TreeSelectColumn</h1>      

    <input type="button" value="save" onclick="saveRow()"/>
<div id="datagrid1" class="mini-datagrid" style="width:700px;height:250px;"  allowResize="true"
    idField="id"
    
    allowCellEdit="true" allowCellSelect="true"
>
    <div property="columns">
        <div type="indexcolumn"></div>
        <div field="loginname" width="120" headerAlign="center" allowSort="true">员工帐号            
        </div>                
        <div type="comboboxcolumn" field="country" width="100" headerAlign="center" valueFromSelect="false">国家
                <input property="editor" class="mini-combobox" style="width:100%;" url="../data/countrys.txt" 
                    allowInput="true"
                />                
        </div>
        <div field="nodeid" type="treeselectcolumn" width="200" allowSort="true" valueFromSelect="false">节点
           <input property="editor" class="mini-treeselect" url="../data/listTree.txt" multiSelect="true" 
                textField="text" valueField="id" parentField="pid" allowInput="true"
            />
        </div>
    </div>
</div>    
    
    <script type="text/javascript">
        var data = [
            { country: "111", nodeid: "datagrid,tree" },
            { country: "usa", nodeid: "ajax" },
            { country: "at", nodeid: "pager" }
        ];

        mini.parse();
        
        var grid = mini.get("datagrid1");
        
        grid.setData(data)

        ///////////////////////////////       
        function saveRow() {
            var data = grid.getChanges();
            var json = mini.encode(data);
            alert(json);
            
        }

    </script>

    <div class="description">
        <h3>Description</h3>
        
    </div>
</body>
</html>